package com.woniu.adopt.mapper;

import com.woniu.adopt.entity.Pet;
import com.woniu.adopt.vo.EchartsVo;
import com.woniu.adopt.vo.PetVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface PetMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Pet record);

    PetVo selectByPrimaryKey(Integer id);

    List<PetVo> selectAll(String name);

    int updateByPrimaryKey(PetVo record);

    void updateByState(@Param("petAdoptId")Integer petAdoptId, @Param("id") Integer id, @Param("state") int state);

    @Select("select count(id) from t_pet where res_id =#{id} and state = 0 and del = 0")
    int selectByRSId(int id);

    List<EchartsVo> selectByViews();
}